XPath is a programming language that may be used to identify subelements of documents in the Extensible Markup Language (XML); it has numerous applications including those in business software and network routing. XPath queries define an analysis that can be performed to an XML document to produce a result set, which may be a subset of the document. A software program or other logic that applies an XPath query to XML documents to produce a result set may sometimes be referred to as an XPath processor. Most XPath processors operate on a tree representation of XML documents, using a process known as the Document Object Model (DOM). Other processors may treat the XML document as a stream of events using a method known as Simple API for XML (SAX).
Processing an XML document using the DOM process may be effective, but may require significant resources in constructing the DOM tree, which may slow the overall functionality of a system or device. A common technique used to process an XML document as SAX events is converting XPath statements in deterministic finite automata (DFAs). DFA processing however is limited in that a processor can only handle those XPath statements for which DFAs have already been defined.